import React, { useCallback, useState } from 'react'
import Children from './Children'

export default function Parent() {
    const [count, setCount] = useState(0)
    //这个函数，你可以理解引用数据类型
    const changeData2 = useCallback(()=>{
        return 123
    },[])
    return (
        <div>
            <h2>Parent</h2>
            <p>{count}</p>
            <button onClick={() => setCount(100)}>修改</button>
            <Children changeData={changeData2}></Children>
        </div>
    )
}
